package org.example.zerenlian.chain.fliter;

import org.example.zerenlian.chain.abstr.DrinkProductAbsService;
import org.example.zerenlian.chain.dto.DrinkDTO;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @author czj
 * @date 2024/12/7
 * @description
 */
@Service
public class DrinkBaseFilter implements DrinkProductAbsService {
    @Override
    public void process(DrinkDTO param) {
        if (Objects.isNull(param.getMilliliter()) || param.getMilliliter().compareTo(BigDecimal.ZERO) <= 0) {
            System.out.println("容量非法");
        }
        if (StringUtils.isEmpty(param.getBrand())) {
            System.out.println("品牌非法");
        }
    }
}
